package com.ysd.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Dateutil {
	public static String getToString(Date date) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.format(date);
	}

	public static Date getToDate(String date) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd ");
		try {
			return sdf.parse(date);
		} catch (ParseException e) {

			e.printStackTrace();
			return null;
		}
	}
}
